Re: [SQL] Using Update

Поиск
Список
Период
Сортировка
От Herouth Maoz
Тема Re: [SQL] Using Update
Дата
Msg-id l03130303b39cec11db6a@[147.233.159.109]
обсуждение исходный текст
Ответ на Using Update  (Christian Rudow <Christian.Rudow@thinx.ch>)
Ответы Re: [SQL] Using Update  ("Ross J. Reedstrom" <reedstrm@wallace.ece.rice.edu>)
Список pgsql-sql
At 11:27 +0300 on 28/06/1999, Christian Rudow wrote:


> I just seem to use the UPDATE not correctly, it cannot be parsed.
> What is the correct solution to this ?
> Can anyone help ?
>
> I know that's a RTFM but I have no FM to R.
> Is there a good SQL tutorial/reference accessible over the net ?

The usual FM is recommended. That is, the PostgreSQL user guide, which
comes with the software, if you compile it from source. Can't guarantee
that it comes with rpms. You can also man (postgres comes with manpages).
And you can also do a "\h update" in psql, to get the bare-bones syntax.

>From the manpage:

SYNOPSIS    update classname set attname-1 = expression-1         [, attname-i = expression-i]         [from from-list]
       [where qual]
 


So, it appears that the correct syntax in Postgres would be:

UPDATE b
SET b.a_id = a.aid
FROM a
WHERE b.custno = a.custno;

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma




В списке pgsql-sql по дате отправления:

Предыдущее
От: Christian Rudow
Дата:
Сообщение: Using Update
Следующее
От: "Ross J. Reedstrom"
Дата:
Сообщение: Re: [SQL] Using Update